home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Languguage OS 2
/
Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO
/
language
/
embedded
/
mcu11
/
gloadd3b.arc
/
GVERD3.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-09-09
|
7KB
|
172 lines
******************************************************************************
******************************************************************************
* *
* Routine to Verify D3 EPROM Contents *
* *
******************************************************************************
* *
* Program Name: GVERD3.ASM *
* Revision: 0.03 *
* Date: 9/09/91 *
* Written By: Robert Chretien *
* Motorola MCU Applications *
* Assembled Under: Motorola Portable Cross Assembler (PASM) or *
* Motorola Freeware Assembler (AS11) *
* Program Description: *
* *
* *
* *
* *
* *
******************************************************************************
* *
* Revision Descriptions: *
* 1. Rev 0.00: Original program. *
* 2. Rev 0.01: Added header and comments. *
* Removed Wait4Trans since was not used. *
* If does not verify the LED is turned off to ID problem board. *
* LED is turned on at start of program. *
* 3. Rev 0.02: Use different means of determining end of s19 file so that *
* now there is no limit to the size of the file. *
* Modified software handshaking to increase speed of transfer *
* between HC11 and IBM. *
* Changed programming delay down to 2ms per spec. *
* 4. Rev 0.03: Gets boot ROM start address from boot reset vector rather *
* than assuming it will always stay the same. *
* *
******************************************************************************
******************************************************************************
RAM EQU $0040
REGS EQU $0000
Eprom EQU $F000
Vectors EQU $FFD6
PortA EQU REGS+$00
PortC EQU REGS+$03
PortB EQU REGS+$04
DDRC EQU REGS+$07
PortD EQU REGS+$08
DDRD EQU REGS+$09
CFORC EQU REGS+$0B
TCNT EQU REGS+$0E
TOC2 EQU REGS+$18
TCTL1 EQU REGS+$20
TCTL2 EQU REGS+$21
TMSK1 EQU REGS+$22
TFLG1 EQU REGS+$23
TMSK2 EQU REGS+$24
TFLG2 EQU REGS+$25
PACTL EQU REGS+$26
Baud EQU REGS+$2B
SCCR2 EQU REGS+$2D
SCSR EQU REGS+$2E
SCDR EQU REGS+$2F
OPTION EQU REGS+$39
*
*
*
TalkAddress EQU RAM
Address EQU RAM+1
RecordLength EQU RAM+3
CheckSum EQU RAM+4
BoardAddress EQU RAM+5
*
*
*
ORG RAM
Initial LDS #$00FF !Set stack pointer to $FF.
LDAA #$30
STAA Baud !With 8MHz crystal, baud=9600.
LDAA #$0C
STAA SCCR2 !Transmitter and receiver enabled.
LDAA #%00100000
STAA DDRD
STAA PortD
*
*
*
CalCheckSum LDAA #$05
STAA CheckSum
CalAddress LDAA PortD
LSRA
LSRA
ANDA #%00000111
STAA BoardAddress
BootRecAddr BSR RecOneAddr
CBA
BNE Boot4Last
STAA SCDR
BSR RecOneAddr
LDAA CheckSum
STAA SCDR
Boot4Last CMPB #08
BNE BootRecAddr
*
*
*
CLR CheckSum
CLR TalkAddress
RecTalk BSR RecOneAddr
CBA
BNE RecNewRec
STAA SCDR
INC TalkAddress
RecNewRec LDX #Address
LDY #3
RecTranInfo BSR RecOneAddr
STAB 0,X
LDAA TalkAddress
BEQ IncX1
STAB SCDR
IncX1 INX
DEY
BNE RecTranInfo
LDX Address
BEQ Wait4Mine
LDAB RecordLength
SUBB #3 !Record length contains byte
CLRA ! count for address and checksum.
XGDY
RecData BSR RecOneAddr
LDAA 0,X
CBA
BEQ OKThisPass
LDAB #$01
STAB CheckSum
LDAB #$00
STAB PortD
OKThisPass LDAB TalkAddress
BEQ IncX2
STAA SCDR
IncX2 INX
DEY
BNE RecData
BRA RecNewRec
Wait4Mine BSR RecOneAddr
CBA
BNE Chck4Last
STAA SCDR
BSR RecOneAddr
LDAA CheckSum
STAA SCDR
Chck4Last CMPB #08
BNE Wait4Mine
BSR RecOneAddr
LDX $BFFE
JMP 0,X !Jump back to Boot ROM.
*
*
*
RecOneAddr LDAA BoardAddress
LDAB SCSR
ANDB #%00100000
BEQ RecOneAddr
LDAB SCDR
RTS
*
*
*
END EQU *
END